import request from "@/utils/http";

// 用户相关接口
export function login(data: { username: string; password: string }) {
  return request({
    url: "/user/login",
    method: "post",
    data,
  });
}
// 获取经纬度和安装位置的电梯
export function getlist(r) {
  return request({
    url: "/elevator/cockpit/getElevators?username=" + r,
    method: "get",
  });
}

// 其他接口...

export function getElevators() {
  return request({
    url: "/cockpit/getElevators",
    method: "get",
  });
}

export function maintenanceRecordPage(e: any) {
  return request({
    url: "/elevator/cockpit/maintenanceRecordPage",
    method: "get",
    params: e,
  });
}

// 电梯数量 左1-1
export function num(e: any) {
  return request({
    url: "/elevator/cockpit/num?username=" + e,
    method: "get",
    // params: e,
  });
}

// 地区电梯数量 左1-2
export function areaCount(e: any) {
  return request({
    url: "/elevator/cockpit/areaCount?username=" + e,
    method: "get",
    // params: e,
  });
}

// 地区电梯数量 左2-1
export function userPlace(e: any) {
  return request({
    url: "/elevator/cockpit/userPlace?username=" + e,
    method: "get",
    // params: e,
  });
}

// 地区电梯数量 左2-2
export function elevatorBrand(e: any) {
  return request({
    url: "/elevator/cockpit/elevatorBrand?username=" + e,
    method: "get",
    // params: e,
  });
}

// 电梯年龄统计
export function elevatorAge(e: any) {
  return request({
    url: "/elevator/cockpit/elevatorAge?username=" + e,
    method: "get",
    // params: e,
  });
}

// 首页-右侧-救援维保次数统计
export function maintenanceStatistics(e: any) {
  return request({
    url: "/elevator/cockpit/maintenanceStatistics?username=" + e,
    method: "get",
    // params: e,
  });
}

// 应急救援-左上-故障单状态统计
export function faultStatistics(e: any) {
  return request({
    url: "/elevator/cockpit/faultStatistics?username=" + e,
    method: "get",
    // params: e,
  });
}

// 维保管理-左上-平均维保时长

export function averageMaintenance(e: any) {
  return request({
    url: "/elevator/cockpit/averageMaintenance?username=" + e,
    method: "get",
    
  });
}

// 维保管理-右上-单位维保/维修工单总数

export function ordersTotal(e: any) {
  return request({
    url: "/elevator/cockpit/ordersTotal?username=" + e,
    method: "get",
    // params: e,
  });
}

// 查看某台电梯实时状态（需要三秒调用一次）
export function getRealtimeStatus(e: any) {
  return request({
    url: "/elevator/cockpit/getRealtimeStatus",
    method: "get",
    params: e,
  });
}
// 查看电梯实时监控地址列表
export function queryPlayUrlLis(e: any) {
  return request({
    url: "/elevator/cockpit/queryPlayUrlList",
    method: "get",
    params: e,
  });
}
// 查看某台电梯实时状态（需要三秒调用一次）
export function queryByRegCode(e: any) {
  return request({
    url: "/elevator/cockpit/queryByRegCode",
    method: "get",
    params: e,
  });
}
// 查看某台电梯实时状态（需要三秒调用一次）
export function faultList(e: any) {
  return request({
    url: "/elevator/cockpit/faultList",
    method: "get",
    params: e,
  });
}

// /cockpit/ordersTotal
// 维保管理-右上-单位维保/维修工单总数

// export function ordersTotal(e: any) {
//   return request({
//     url: "/cockpit/ordersTotal",
//     method: "get",
//     params: e,
//   });
// }

// 维保管理-右下-单位月平均维保/维修统计

export function unitAverageMaintenance(e: any) {
  return request({
    url: "/elevator/cockpit/unitAverageMaintenance",
    method: "get",
    params: e,
  });
}
// 应急救援-左上点击-故障单状态列表

export function GetFaultList(e: any,f: any) {
  return request({
    url: "/elevator/cockpit/faultList?username=" + f,
    method: "get",
    params: e,
  });
}
